/**
 * @author zqd	差旅小组
 *
 * 上午09:03:48
 */
package com.cbts.dao.impl;

import java.io.Serializable;
import java.sql.SQLException;
import java.util.List;

import org.hibernate.HibernateException;
import org.hibernate.Query;
import org.hibernate.Session;
import org.springframework.orm.hibernate3.HibernateCallback;

import com.cbts.dao.BusinessTravelDao;
import com.cbts.entity.BusinessTravel;
import com.cbts.util.Page;

public class BusinessTravelDaoImpl extends BaseDaoImpl<BusinessTravel>
		implements BusinessTravelDao {

	/* 
	 * @see com.cbts.dao.BusinessTravelDao#deleteByTravelOrder(java.lang.String)
	 */
	@SuppressWarnings("unchecked")
	public boolean deleteByTravelOrder(final String travelOrder) {
		// zqd 下午09:27:14
		return getHibernateTemplate().execute(new HibernateCallback(){
			 public Object doInHibernate(Session session)
				throws HibernateException, SQLException {
				Query query = session.createQuery("delete from BusinessTravel where travelOrder = "+"\'"+travelOrder+"\'");
				int i=query.executeUpdate();
				if(i==0) return false;
				else return true;
			 }
		});
	}

}
